package com.itextpdf.text.pdf;

import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Font;
import com.itextpdf.tool.xml.XMLWorkerFontProvider;

/**
 * Created by zc on 2017/3/16.
 */
public class ChineseFontProvider extends XMLWorkerFontProvider {
    public ChineseFontProvider() {
    }

    public Font getFont(String fontname, String encoding, boolean embedded, float size, int style, BaseColor color) {
        BaseFont bf = null;

        try {
            bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
        } catch (Exception var9) {
            var9.printStackTrace();
        }

        Font font = new Font(bf, size, style, color);
        font.setColor(color);
        return font;
    }
}
